#include <iostream>
using namespace std;

const char
	SUCCESS[] = "success",
	FAILURE[] = "failure",
	ON_DAY[] = " on day ";

double h, u, d, f;
int day;


const char * process ()
{
	double distance;

	f = u * f / 100.0;
	distance = 0.0;
	day = 1;

	while (true)
	{
		distance += u;
		if (distance > h)
		{
			return SUCCESS;
		}
		distance -= d;
		if (distance < 0.0)
		{
			return FAILURE;
		}
		++day;
		u = max (u - f, 0.0);
	}
}


int main ()
{
	const char * result;
	while (cin >> h >> u >> d >> f, h != 0.0)
	{
		result = process();
		cout << result << ON_DAY << day << endl;
	}

	return 0;
}